package provide TMD 1.0
namespace eval TMD {
proc addModule { fname } {
   global loaded
   if ![info exists loaded] { set loaded {}}
   set mydir [file dirname [dict get [info frame [info frame]] file ]]
   foreach f [list [file join $mydir $fname] $fname ] {
      if [file exists $f] {set fname $f; break}
   }
   if {[lsearch $loaded $fname] >=0} { return}
   set olddir [pwd]
   #puts "loaded $fname"
   cd [file dirname $fname]
   lappend loaded $fname
   uplevel 1 "source $fname"
   cd $olddir
}
}
#load core
TMD::addModule core/Interface.tcl
TMD::addModule core/Charmm.tcl
TMD::addModule core/Threaded.tcl
#load utilities
TMD::addModule utilities/random.tcl

#load modules
TMD::addModule modules/IO/IO.tcl
TMD::addModule modules/solvation/implicit.tcl
TMD::addModule modules/energy/energy.tcl
TMD::addModule modules/energy/NMA.tcl
TMD::addModule modules/MD/MD.tcl
TMD::addModule modules/sequence/segment.tcl
TMD::addModule modules/conf/conf.tcl
TMD::addModule modules/geo/geo.tcl
